import routerMap from './router.map'
import {parseRoutes} from '@/utils/routerUtil'

// 异步路由配置
const routesConfig = [
  'login',
  'root',
  'register',
  'forgetPassword',
  {
    router: 'exp404',
    path: '*',
    name: '404',
    meta: {
    },
  },
  {
    router: 'exp403',
    path: '/403',
    name: '403',
    meta: {
    },
  }
]

const options = {
  // mode: 'history', // require service support
  base: process.env.VUE_APP_PUBLIC_PATH,
  scrollBehavior: () => ({ y: 0 }),
  routes: parseRoutes(routesConfig, routerMap)
}

export default options
